package org.light.generator;

import java.util.ArrayList;
import java.util.List;

import org.javaforever.gatescore.utils.StringUtil;
import org.light.core.Writeable;
import org.light.domain.Statement;
import org.light.domain.Util;
import org.light.utils.WriteableUtil;

public class ExcelUtilGenerator extends Util{
	public ExcelUtilGenerator(){
		super();
		super.fileName = "ExcelUtil.go";
	}
	
	public ExcelUtilGenerator(String packageToken){
		super();
		this.setPackageToken(packageToken);
		super.fileName = "ExcelUtil.go";
	}
	
	@Override
	public void setPackageToken(String packageToken) {
		this.packageToken = packageToken;
	}
	
	public String getPackageTokenWithDot() {
		if (StringUtil.isBlank(this.getPackageToken())) return "";
		else return this.getPackageToken()+".";
	}
	
	@Override
	public String generateUtilString() {
		List<Writeable> sList = new ArrayList<Writeable>();
		sList.add(new Statement(1000L,0,"package "+this.getPackageTokenWithDot()+"utils"));
		sList.add(new Statement(2000L,0,""));
		sList.add(new Statement(3000L,0,"import ("));
		sList.add(new Statement(4000L,1,"\"bytes\""));
		sList.add(new Statement(5000L,1,"\"fmt\""));
		sList.add(new Statement(6000L,1,"\"image\""));
		sList.add(new Statement(7000L,1,"\"strconv\""));
		sList.add(new Statement(8000L,0,""));
		sList.add(new Statement(9000L,1,"_ \"image/gif\""));
		sList.add(new Statement(10000L,1,"_ \"image/jpeg\""));
		sList.add(new Statement(11000L,1,"_ \"image/png\""));
		sList.add(new Statement(12000L,0,""));
		sList.add(new Statement(13000L,1,"\"github.com/xuri/excelize/v2\""));
		sList.add(new Statement(14000L,0,")"));
		sList.add(new Statement(15000L,0,""));
		sList.add(new Statement(16000L,0,"func ExportExcelWorkbookWithImage(sheetName string, headers []string,"));
		sList.add(new Statement(17000L,1,"contents [][]interface{}, isImages []bool) *excelize.File {"));
		sList.add(new Statement(18000L,1,"colCount := len(isImages)"));
		sList.add(new Statement(19000L,1,"rowCount := 0"));
		sList.add(new Statement(20000L,1,"if (contents != nil) {"));
		sList.add(new Statement(21000L,2,"rowCount = len(contents)"));
		sList.add(new Statement(22000L,1,"}"));
		sList.add(new Statement(23000L,0,""));
		sList.add(new Statement(24000L,1,"containsImage := ContainsImage(isImages)"));
		sList.add(new Statement(25000L,1,"rowHeight := 30"));
		sList.add(new Statement(26000L,1,"if containsImage {"));
		sList.add(new Statement(27000L,2,"rowHeight = 50"));
		sList.add(new Statement(28000L,1,"}"));
		sList.add(new Statement(29000L,1,"f := excelize.NewFile()"));
		sList.add(new Statement(30000L,1,"// Create a new sheet."));
		sList.add(new Statement(31000L,1,"index := f.NewSheet(sheetName)"));
		sList.add(new Statement(32000L,1,"endColName, _ := excelize.ColumnNumberToName( colCount+ 1)"));
		sList.add(new Statement(33000L,0,""));
		sList.add(new Statement(34000L,1,"f.SetColWidth(sheetName, \"B\", endColName, 16)"));
		sList.add(new Statement(35000L,1,"f.SetRowHeight(sheetName, 2, 30)"));
		sList.add(new Statement(36000L,1,"f.SetSheetRow(sheetName, \"B2\", &headers)"));
		sList.add(new Statement(37000L,1,"_ = f.SetCellStyle(sheetName, \"B3\", endColName+strconv.FormatInt(int64(rowCount+2), 10), bodyStyle(f))"));
		sList.add(new Statement(38000L,1,"if (rowCount == 0){"));
		sList.add(new Statement(39000L,2,"f.SetRowHeight(sheetName, 3, 30)"));
		sList.add(new Statement(40000L,2,"for j := 0; j < colCount; j++ {"));
		sList.add(new Statement(41000L,3,"currentColName, _ := excelize.ColumnNumberToName(j + 2)"));
		sList.add(new Statement(42000L,3,"f.SetCellStr(sheetName, currentColName+strconv.FormatInt(int64(3), 10), \"\")"));
		sList.add(new Statement(43000L,2,"}"));
		sList.add(new Statement(44000L,1,"}"));
		sList.add(new Statement(45000L,1,"for i := 0; i < rowCount; i++ {"));
		sList.add(new Statement(46000L,2,"f.SetRowHeight(sheetName, i+3, float64(rowHeight))"));
		sList.add(new Statement(47000L,2,"for j := 0; j < colCount; j++ {"));
		sList.add(new Statement(48000L,3,"currentColName, _ := excelize.ColumnNumberToName(j + 2)"));
		sList.add(new Statement(49000L,3,"if isImages[j] == true {"));
		sList.add(new Statement(50000L,4,"raw := contents[i][j].([]byte)"));
		sList.add(new Statement(51000L,4,"if raw != nil {"));
		sList.add(new Statement(52000L,5,"c, _, _ := image.DecodeConfig(bytes.NewReader(raw))"));
		sList.add(new Statement(53000L,5,"ratio := float64(70) / float64(c.Height)"));
		sList.add(new Statement(54000L,5,"offsetx := int64((float64(130) - float64(c.Width)*ratio) / float64(2))"));
		sList.add(new Statement(55000L,5,"fmt.Println(ratio)"));
		sList.add(new Statement(56000L,5,"var imgStyhle string = fmt.Sprintf(`{\"x_offset\": %d ,\"y_offset\": 0,\"x_scale\":%4.4f,\"y_scale\":%4.4f,\"print_obj\": true,\"lock_aspect_ratio\": true,\"locked\": false	}`, offsetx, ratio, ratio)"));
		sList.add(new Statement(57000L,5,"fmt.Println(\"JerryDubeg:\" + imgStyhle)"));
		sList.add(new Statement(58000L,5,"if err := f.AddPictureFromBytes(sheetName, currentColName+strconv.FormatInt(int64(i+3), 10), imgStyhle, \"picture\"+strconv.FormatInt(int64(i+3), 10)+strconv.FormatInt(int64(j), 10), \".jpg\", raw); err != nil {"));
		sList.add(new Statement(59000L,6,"fmt.Println(err)"));
		sList.add(new Statement(60000L,5,"}"));
		sList.add(new Statement(61000L,4,"}"));
		sList.add(new Statement(62000L,3,"} else {"));
		sList.add(new Statement(63000L,4,"f.SetCellStr(sheetName, currentColName+strconv.FormatInt(int64(i+3), 10), contents[i][j].(string))"));
		sList.add(new Statement(64000L,3,"}"));
		sList.add(new Statement(65000L,2,"}"));
		sList.add(new Statement(66000L,1,"}"));
		sList.add(new Statement(67000L,1,""));
		sList.add(new Statement(68000L,1,"outputRowEnd := rowCount+2"));
		sList.add(new Statement(69000L,1,"if rowCount == 0 {"));
		sList.add(new Statement(70000L,2,"outputRowEnd = 3"));
		sList.add(new Statement(71000L,1,"}"));
		sList.add(new Statement(72000L,1,""));
		sList.add(new Statement(73000L,1,"outBoxStyle(f, sheetName, \"B\", endColName, 2, outputRowEnd)"));
		sList.add(new Statement(74000L,1,"// Set active sheet of the workbook."));
		sList.add(new Statement(75000L,1,"f.SetActiveSheet(index)"));
		sList.add(new Statement(76000L,1,"return f"));
		sList.add(new Statement(77000L,0,"}"));
		sList.add(new Statement(78000L,0,""));
		sList.add(new Statement(79000L,0,"func ContainsImage(isImages []bool) bool {"));
		sList.add(new Statement(80000L,1,"for _, isImage := range isImages {"));
		sList.add(new Statement(81000L,2,"if isImage {"));
		sList.add(new Statement(82000L,3,"return true"));
		sList.add(new Statement(83000L,2,"}"));
		sList.add(new Statement(84000L,1,"}"));
		sList.add(new Statement(85000L,1,"return false"));
		sList.add(new Statement(86000L,0,"}"));
		sList.add(new Statement(87000L,0,""));
		sList.add(new Statement(88000L,0,"func headStyle(f *excelize.File) int {"));
		sList.add(new Statement(89000L,1,"style, err := f.NewStyle(`{"));
		sList.add(new Statement(90000L,2,"\"border\": ["));
		sList.add(new Statement(91000L,2,"{"));
		sList.add(new Statement(92000L,3,"\"type\": \"left\","));
		sList.add(new Statement(93000L,3,"\"color\": \"000000\","));
		sList.add(new Statement(94000L,3,"\"style\": 1"));
		sList.add(new Statement(95000L,2,"},"));
		sList.add(new Statement(96000L,2,"{"));
		sList.add(new Statement(97000L,3,"\"type\": \"top\","));
		sList.add(new Statement(98000L,3,"\"color\":\"000000\","));
		sList.add(new Statement(99000L,3,"\"style\": 1"));
		sList.add(new Statement(100000L,2,"},"));
		sList.add(new Statement(101000L,2,"{"));
		sList.add(new Statement(102000L,3,"\"type\": \"bottom\","));
		sList.add(new Statement(103000L,3,"\"color\":\"000000\","));
		sList.add(new Statement(104000L,3,"\"style\":1"));
		sList.add(new Statement(105000L,2,"},"));
		sList.add(new Statement(106000L,2,"{"));
		sList.add(new Statement(107000L,3,"\"type\": \"right\","));
		sList.add(new Statement(108000L,3,"\"color\":\"000000\","));
		sList.add(new Statement(109000L,3,"\"style\": 1"));
		sList.add(new Statement(110000L,2,"}],"));
		sList.add(new Statement(111000L,2,"\"fill\":{"));
		sList.add(new Statement(112000L,3,"\"type\":\"pattern\","));
		sList.add(new Statement(113000L,3,"\"color\":["));
		sList.add(new Statement(114000L,5,"\"#FFFF00\""));
		sList.add(new Statement(115000L,3,"],"));
		sList.add(new Statement(116000L,3,"\"pattern\":1"));
		sList.add(new Statement(117000L,2,"},"));
		sList.add(new Statement(118000L,2,"\"alignment\":"));
		sList.add(new Statement(119000L,2,"{"));
		sList.add(new Statement(120000L,3,"\"horizontal\": \"center\","));
		sList.add(new Statement(121000L,3,"\"vertical\": \"center\""));
		sList.add(new Statement(122000L,2,"}"));
		sList.add(new Statement(123000L,1,"}`)"));
		sList.add(new Statement(124000L,1,"if err != nil {"));
		sList.add(new Statement(125000L,2,"fmt.Println(err)"));
		sList.add(new Statement(126000L,1,"}"));
		sList.add(new Statement(127000L,1,"return style"));
		sList.add(new Statement(128000L,0,"}"));
		sList.add(new Statement(129000L,0,""));
		sList.add(new Statement(130000L,0,"func bodyStyle(f *excelize.File) int {"));
		sList.add(new Statement(131000L,1,"style, err := f.NewStyle(`{"));
		sList.add(new Statement(132000L,2,"\"border\": ["));
		sList.add(new Statement(133000L,2,"{"));
		sList.add(new Statement(134000L,3,"\"type\": \"left\","));
		sList.add(new Statement(135000L,3,"\"color\": \"000000\","));
		sList.add(new Statement(136000L,3,"\"style\": 1"));
		sList.add(new Statement(137000L,2,"},"));
		sList.add(new Statement(138000L,2,"{"));
		sList.add(new Statement(139000L,3,"\"type\": \"top\","));
		sList.add(new Statement(140000L,3,"\"color\":\"000000\","));
		sList.add(new Statement(141000L,3,"\"style\": 1"));
		sList.add(new Statement(142000L,2,"},"));
		sList.add(new Statement(143000L,2,"{"));
		sList.add(new Statement(144000L,3,"\"type\": \"bottom\","));
		sList.add(new Statement(145000L,3,"\"color\":\"000000\","));
		sList.add(new Statement(146000L,3,"\"style\":1"));
		sList.add(new Statement(147000L,2,"},"));
		sList.add(new Statement(148000L,2,"{"));
		sList.add(new Statement(149000L,3,"\"type\": \"right\","));
		sList.add(new Statement(150000L,3,"\"color\":\"000000\","));
		sList.add(new Statement(151000L,3,"\"style\": 1"));
		sList.add(new Statement(152000L,2,"}],"));
		sList.add(new Statement(153000L,2,"\"alignment\":"));
		sList.add(new Statement(154000L,2,"{"));
		sList.add(new Statement(155000L,3,"\"horizontal\": \"center\","));
		sList.add(new Statement(156000L,3,"\"vertical\": \"center\""));
		sList.add(new Statement(157000L,2,"}"));
		sList.add(new Statement(158000L,1,"}`)"));
		sList.add(new Statement(159000L,1,"if err != nil {"));
		sList.add(new Statement(160000L,2,"fmt.Println(err)"));
		sList.add(new Statement(161000L,1,"}"));
		sList.add(new Statement(162000L,1,"return style"));
		sList.add(new Statement(163000L,0,"}"));
		sList.add(new Statement(164000L,0,""));
		sList.add(new Statement(165000L,0,"func outBoxStyle(f *excelize.File, sheetName string, colBegin string, colEnd string, rowBegin int, rowEnd int) {"));
		sList.add(new Statement(166000L,1,"styleleft, err := f.NewStyle(`{"));
		sList.add(new Statement(167000L,2,"\"border\": ["));
		sList.add(new Statement(168000L,2,"{"));
		sList.add(new Statement(169000L,3,"\"type\": \"left\","));
		sList.add(new Statement(170000L,3,"\"color\": \"000000\","));
		sList.add(new Statement(171000L,3,"\"style\": 2"));
		sList.add(new Statement(172000L,2,"},"));
		sList.add(new Statement(173000L,2,"{"));
		sList.add(new Statement(174000L,3,"\"type\": \"top\","));
		sList.add(new Statement(175000L,3,"\"color\":\"000000\","));
		sList.add(new Statement(176000L,3,"\"style\": 1"));
		sList.add(new Statement(177000L,2,"},"));
		sList.add(new Statement(178000L,2,"{"));
		sList.add(new Statement(179000L,3,"\"type\": \"bottom\","));
		sList.add(new Statement(180000L,3,"\"color\":\"000000\","));
		sList.add(new Statement(181000L,3,"\"style\":1"));
		sList.add(new Statement(182000L,2,"},"));
		sList.add(new Statement(183000L,2,"{"));
		sList.add(new Statement(184000L,3,"\"type\": \"right\","));
		sList.add(new Statement(185000L,3,"\"color\":\"000000\","));
		sList.add(new Statement(186000L,3,"\"style\": 1"));
		sList.add(new Statement(187000L,2,"}"));
		sList.add(new Statement(188000L,2,"],"));
		sList.add(new Statement(189000L,2,"\"alignment\":"));
		sList.add(new Statement(190000L,2,"{"));
		sList.add(new Statement(191000L,3,"\"horizontal\": \"center\","));
		sList.add(new Statement(192000L,3,"\"vertical\": \"center\""));
		sList.add(new Statement(193000L,2,"}"));
		sList.add(new Statement(194000L,1,"}`)"));
		sList.add(new Statement(195000L,1,"styleright, err := f.NewStyle(`{"));
		sList.add(new Statement(196000L,2,"\"border\": ["));
		sList.add(new Statement(197000L,2,"{"));
		sList.add(new Statement(198000L,3,"\"type\": \"right\","));
		sList.add(new Statement(199000L,3,"\"color\": \"000000\","));
		sList.add(new Statement(200000L,3,"\"style\":2"));
		sList.add(new Statement(201000L,2,"},"));
		sList.add(new Statement(202000L,2,"{"));
		sList.add(new Statement(203000L,3,"\"type\": \"left\","));
		sList.add(new Statement(204000L,3,"\"color\": \"000000\","));
		sList.add(new Statement(205000L,3,"\"style\": 1"));
		sList.add(new Statement(206000L,2,"},"));
		sList.add(new Statement(207000L,2,"{"));
		sList.add(new Statement(208000L,3,"\"type\": \"top\","));
		sList.add(new Statement(209000L,3,"\"color\":\"000000\","));
		sList.add(new Statement(210000L,3,"\"style\": 1"));
		sList.add(new Statement(211000L,2,"},"));
		sList.add(new Statement(212000L,2,"{"));
		sList.add(new Statement(213000L,3,"\"type\": \"bottom\","));
		sList.add(new Statement(214000L,3,"\"color\":\"000000\","));
		sList.add(new Statement(215000L,3,"\"style\":1"));
		sList.add(new Statement(216000L,2,"}],"));
		sList.add(new Statement(217000L,2,"\"alignment\":"));
		sList.add(new Statement(218000L,2,"{"));
		sList.add(new Statement(219000L,3,"\"horizontal\": \"center\","));
		sList.add(new Statement(220000L,3,"\"vertical\": \"center\""));
		sList.add(new Statement(221000L,2,"}"));
		sList.add(new Statement(222000L,1,"}`)"));
		sList.add(new Statement(223000L,1,"styletop, err := f.NewStyle(`{"));
		sList.add(new Statement(224000L,2,"\"border\": ["));
		sList.add(new Statement(225000L,2,"{"));
		sList.add(new Statement(226000L,3,"\"type\": \"top\","));
		sList.add(new Statement(227000L,3,"\"color\": \"000000\","));
		sList.add(new Statement(228000L,3,"\"style\":2"));
		sList.add(new Statement(229000L,2,"},"));
		sList.add(new Statement(230000L,2,"{"));
		sList.add(new Statement(231000L,3,"\"type\": \"left\","));
		sList.add(new Statement(232000L,3,"\"color\": \"000000\","));
		sList.add(new Statement(233000L,3,"\"style\": 1"));
		sList.add(new Statement(234000L,2,"},"));
		sList.add(new Statement(235000L,2,"{"));
		sList.add(new Statement(236000L,3,"\"type\": \"bottom\","));
		sList.add(new Statement(237000L,3,"\"color\":\"000000\","));
		sList.add(new Statement(238000L,3,"\"style\":1"));
		sList.add(new Statement(239000L,2,"},"));
		sList.add(new Statement(240000L,2,"{"));
		sList.add(new Statement(241000L,3,"\"type\": \"right\","));
		sList.add(new Statement(242000L,3,"\"color\":\"000000\","));
		sList.add(new Statement(243000L,3,"\"style\": 1"));
		sList.add(new Statement(244000L,2,"}],"));
		sList.add(new Statement(245000L,2,"\"fill\":{"));
		sList.add(new Statement(246000L,3,"\"type\":\"pattern\","));
		sList.add(new Statement(247000L,3,"\"color\":["));
		sList.add(new Statement(248000L,5,"\"#FFFF00\""));
		sList.add(new Statement(249000L,3,"],"));
		sList.add(new Statement(250000L,3,"\"pattern\":1"));
		sList.add(new Statement(251000L,2,"},"));
		sList.add(new Statement(252000L,2,"\"alignment\":"));
		sList.add(new Statement(253000L,2,"{"));
		sList.add(new Statement(254000L,3,"\"horizontal\": \"center\","));
		sList.add(new Statement(255000L,3,"\"vertical\": \"center\""));
		sList.add(new Statement(256000L,2,"}"));
		sList.add(new Statement(257000L,1,"}`)"));
		sList.add(new Statement(258000L,1,"stylebottom, err := f.NewStyle(`{"));
		sList.add(new Statement(259000L,2,"\"border\": ["));
		sList.add(new Statement(260000L,2,"{"));
		sList.add(new Statement(261000L,3,"\"type\": \"bottom\","));
		sList.add(new Statement(262000L,3,"\"color\": \"000000\","));
		sList.add(new Statement(263000L,3,"\"style\":2"));
		sList.add(new Statement(264000L,2,"},"));
		sList.add(new Statement(265000L,2,"{"));
		sList.add(new Statement(266000L,3,"\"type\": \"left\","));
		sList.add(new Statement(267000L,3,"\"color\": \"000000\","));
		sList.add(new Statement(268000L,3,"\"style\": 1"));
		sList.add(new Statement(269000L,2,"},"));
		sList.add(new Statement(270000L,2,"{"));
		sList.add(new Statement(271000L,3,"\"type\": \"top\","));
		sList.add(new Statement(272000L,3,"\"color\":\"000000\","));
		sList.add(new Statement(273000L,3,"\"style\": 1"));
		sList.add(new Statement(274000L,2,"},"));
		sList.add(new Statement(275000L,2,"{"));
		sList.add(new Statement(276000L,3,"\"type\": \"right\","));
		sList.add(new Statement(277000L,3,"\"color\":\"000000\","));
		sList.add(new Statement(278000L,3,"\"style\": 1"));
		sList.add(new Statement(279000L,2,"}],"));
		sList.add(new Statement(280000L,2,"\"alignment\":"));
		sList.add(new Statement(281000L,2,"{"));
		sList.add(new Statement(282000L,3,"\"horizontal\": \"center\","));
		sList.add(new Statement(283000L,3,"\"vertical\": \"center\""));
		sList.add(new Statement(284000L,2,"}"));
		sList.add(new Statement(285000L,1,"}`)"));
		sList.add(new Statement(286000L,0,""));
		sList.add(new Statement(287000L,1,"styleTopLeft, err := f.NewStyle(`{"));
		sList.add(new Statement(288000L,2,"\"border\": ["));
		sList.add(new Statement(289000L,2,"{"));
		sList.add(new Statement(290000L,3,"\"type\": \"top\","));
		sList.add(new Statement(291000L,3,"\"color\": \"000000\","));
		sList.add(new Statement(292000L,3,"\"style\":2"));
		sList.add(new Statement(293000L,2,"},"));
		sList.add(new Statement(294000L,2,"{"));
		sList.add(new Statement(295000L,3,"\"type\": \"left\","));
		sList.add(new Statement(296000L,3,"\"color\": \"000000\","));
		sList.add(new Statement(297000L,3,"\"style\": 2"));
		sList.add(new Statement(298000L,2,"},"));
		sList.add(new Statement(299000L,2,"{"));
		sList.add(new Statement(300000L,3,"\"type\": \"bottom\","));
		sList.add(new Statement(301000L,3,"\"color\":\"000000\","));
		sList.add(new Statement(302000L,3,"\"style\":1"));
		sList.add(new Statement(303000L,2,"},"));
		sList.add(new Statement(304000L,2,"{"));
		sList.add(new Statement(305000L,3,"\"type\": \"right\","));
		sList.add(new Statement(306000L,3,"\"color\":\"000000\","));
		sList.add(new Statement(307000L,3,"\"style\": 1"));
		sList.add(new Statement(308000L,2,"}],"));
		sList.add(new Statement(309000L,2,"\"fill\":{"));
		sList.add(new Statement(310000L,3,"\"type\":\"pattern\","));
		sList.add(new Statement(311000L,3,"\"color\":["));
		sList.add(new Statement(312000L,5,"\"#FFFF00\""));
		sList.add(new Statement(313000L,3,"],"));
		sList.add(new Statement(314000L,3,"\"pattern\":1"));
		sList.add(new Statement(315000L,2,"},"));
		sList.add(new Statement(316000L,2,"\"alignment\":"));
		sList.add(new Statement(317000L,2,"{"));
		sList.add(new Statement(318000L,3,"\"horizontal\": \"center\","));
		sList.add(new Statement(319000L,3,"\"vertical\": \"center\""));
		sList.add(new Statement(320000L,2,"}"));
		sList.add(new Statement(321000L,1,"}`)"));
		sList.add(new Statement(322000L,0,""));
		sList.add(new Statement(323000L,1,"styleTopRight, err := f.NewStyle(`{"));
		sList.add(new Statement(324000L,2,"\"border\": ["));
		sList.add(new Statement(325000L,2,"{"));
		sList.add(new Statement(326000L,3,"\"type\": \"top\","));
		sList.add(new Statement(327000L,3,"\"color\": \"000000\","));
		sList.add(new Statement(328000L,3,"\"style\":2"));
		sList.add(new Statement(329000L,2,"},"));
		sList.add(new Statement(330000L,2,"{"));
		sList.add(new Statement(331000L,3,"\"type\": \"left\","));
		sList.add(new Statement(332000L,3,"\"color\": \"000000\","));
		sList.add(new Statement(333000L,3,"\"style\": 1"));
		sList.add(new Statement(334000L,2,"},"));
		sList.add(new Statement(335000L,2,"{"));
		sList.add(new Statement(336000L,3,"\"type\": \"bottom\","));
		sList.add(new Statement(337000L,3,"\"color\":\"000000\","));
		sList.add(new Statement(338000L,3,"\"style\":1"));
		sList.add(new Statement(339000L,2,"},"));
		sList.add(new Statement(340000L,2,"{"));
		sList.add(new Statement(341000L,3,"\"type\": \"right\","));
		sList.add(new Statement(342000L,3,"\"color\":\"000000\","));
		sList.add(new Statement(343000L,3,"\"style\": 2"));
		sList.add(new Statement(344000L,2,"}],"));
		sList.add(new Statement(345000L,2,"\"fill\":{"));
		sList.add(new Statement(346000L,3,"\"type\":\"pattern\","));
		sList.add(new Statement(347000L,3,"\"color\":["));
		sList.add(new Statement(348000L,5,"\"#FFFF00\""));
		sList.add(new Statement(349000L,3,"],"));
		sList.add(new Statement(350000L,3,"\"pattern\":1"));
		sList.add(new Statement(351000L,2,"},"));
		sList.add(new Statement(352000L,2,"\"alignment\":"));
		sList.add(new Statement(353000L,2,"{"));
		sList.add(new Statement(354000L,3,"\"horizontal\": \"center\","));
		sList.add(new Statement(355000L,3,"\"vertical\": \"center\""));
		sList.add(new Statement(356000L,2,"}"));
		sList.add(new Statement(357000L,1,"}`)"));
		sList.add(new Statement(358000L,0,""));
		sList.add(new Statement(359000L,1,"styleBottomLeft, err := f.NewStyle(`{"));
		sList.add(new Statement(360000L,2,"\"border\": ["));
		sList.add(new Statement(361000L,2,"{"));
		sList.add(new Statement(362000L,3,"\"type\": \"bottom\","));
		sList.add(new Statement(363000L,3,"\"color\": \"000000\","));
		sList.add(new Statement(364000L,3,"\"style\":2"));
		sList.add(new Statement(365000L,2,"},"));
		sList.add(new Statement(366000L,2,"{"));
		sList.add(new Statement(367000L,3,"\"type\": \"left\","));
		sList.add(new Statement(368000L,3,"\"color\": \"000000\","));
		sList.add(new Statement(369000L,3,"\"style\": 2"));
		sList.add(new Statement(370000L,2,"},"));
		sList.add(new Statement(371000L,2,"{"));
		sList.add(new Statement(372000L,3,"\"type\": \"top\","));
		sList.add(new Statement(373000L,3,"\"color\":\"000000\","));
		sList.add(new Statement(374000L,3,"\"style\": 1"));
		sList.add(new Statement(375000L,2,"},"));
		sList.add(new Statement(376000L,2,"{"));
		sList.add(new Statement(377000L,3,"\"type\": \"right\","));
		sList.add(new Statement(378000L,3,"\"color\":\"000000\","));
		sList.add(new Statement(379000L,3,"\"style\": 1"));
		sList.add(new Statement(380000L,2,"}],"));
		sList.add(new Statement(381000L,2,"\"alignment\":"));
		sList.add(new Statement(382000L,2,"{"));
		sList.add(new Statement(383000L,3,"\"horizontal\": \"center\","));
		sList.add(new Statement(384000L,3,"\"vertical\": \"center\""));
		sList.add(new Statement(385000L,2,"}"));
		sList.add(new Statement(386000L,1,"}`)"));
		sList.add(new Statement(387000L,0,""));
		sList.add(new Statement(388000L,1,"styleBottomRight, err := f.NewStyle(`{"));
		sList.add(new Statement(389000L,2,"\"border\": ["));
		sList.add(new Statement(390000L,2,"{"));
		sList.add(new Statement(391000L,3,"\"type\": \"bottom\","));
		sList.add(new Statement(392000L,3,"\"color\": \"000000\","));
		sList.add(new Statement(393000L,3,"\"style\":2"));
		sList.add(new Statement(394000L,2,"},"));
		sList.add(new Statement(395000L,2,"{"));
		sList.add(new Statement(396000L,3,"\"type\": \"left\","));
		sList.add(new Statement(397000L,3,"\"color\": \"000000\","));
		sList.add(new Statement(398000L,3,"\"style\": 1"));
		sList.add(new Statement(399000L,2,"},"));
		sList.add(new Statement(400000L,2,"{"));
		sList.add(new Statement(401000L,3,"\"type\": \"top\","));
		sList.add(new Statement(402000L,3,"\"color\":\"000000\","));
		sList.add(new Statement(403000L,3,"\"style\": 1"));
		sList.add(new Statement(404000L,2,"},"));
		sList.add(new Statement(405000L,2,"{"));
		sList.add(new Statement(406000L,3,"\"type\": \"right\","));
		sList.add(new Statement(407000L,3,"\"color\":\"000000\","));
		sList.add(new Statement(408000L,3,"\"style\": 2"));
		sList.add(new Statement(409000L,2,"}],"));
		sList.add(new Statement(410000L,2,"\"alignment\":"));
		sList.add(new Statement(411000L,2,"{"));
		sList.add(new Statement(412000L,3,"\"horizontal\": \"center\","));
		sList.add(new Statement(413000L,3,"\"vertical\": \"center\""));
		sList.add(new Statement(414000L,2,"}"));
		sList.add(new Statement(415000L,1,"}`)"));
		sList.add(new Statement(416000L,0,""));
		sList.add(new Statement(417000L,1,"if err != nil {"));
		sList.add(new Statement(418000L,2,"fmt.Println(err)"));
		sList.add(new Statement(419000L,1,"}"));
		sList.add(new Statement(420000L,1,"_ = f.SetCellStyle(sheetName, colBegin+strconv.FormatInt(int64(rowBegin), 10), colEnd+strconv.FormatInt(int64(rowBegin), 10), styletop)"));
		sList.add(new Statement(421000L,1,"_ = f.SetCellStyle(sheetName, colBegin+strconv.FormatInt(int64(rowEnd), 10), colEnd+strconv.FormatInt(int64(rowEnd), 10), stylebottom)"));
		sList.add(new Statement(422000L,1,"_ = f.SetCellStyle(sheetName, colBegin+strconv.FormatInt(int64(rowBegin), 10), colBegin+strconv.FormatInt(int64(rowEnd), 10), styleleft)"));
		sList.add(new Statement(423000L,1,"_ = f.SetCellStyle(sheetName, colEnd+strconv.FormatInt(int64(rowBegin), 10), colEnd+strconv.FormatInt(int64(rowEnd), 10), styleright)"));
		sList.add(new Statement(424000L,0,""));
		sList.add(new Statement(425000L,1,"_ = f.SetCellStyle(sheetName, colBegin+strconv.FormatInt(int64(rowBegin), 10), colBegin+strconv.FormatInt(int64(rowBegin), 10), styleTopLeft)"));
		sList.add(new Statement(426000L,1,"_ = f.SetCellStyle(sheetName, colEnd+strconv.FormatInt(int64(rowBegin), 10), colEnd+strconv.FormatInt(int64(rowBegin), 10), styleTopRight)"));
		sList.add(new Statement(427000L,1,"_ = f.SetCellStyle(sheetName, colBegin+strconv.FormatInt(int64(rowEnd), 10), colBegin+strconv.FormatInt(int64(rowEnd), 10), styleBottomLeft)"));
		sList.add(new Statement(428000L,1,"_ = f.SetCellStyle(sheetName, colEnd+strconv.FormatInt(int64(rowEnd), 10), colEnd+strconv.FormatInt(int64(rowEnd), 10), styleBottomRight)"));
		sList.add(new Statement(429000L,1,"err = nil"));
		sList.add(new Statement(430000L,0,"}"));

		return WriteableUtil.merge(sList).getContent();
	}

}
